package cn.kuaida.oop;

import cn.kuaida.oop.Game;

import java.util.Scanner;

public class Player {
    private int levelNo;
    private int currScore;
    private  long  startTime;
    private int  elapsedTime;
    public void play(){
        Game game=new Game(this);
        Scanner input=new Scanner(System.in);
        this.levelNo=0;
        for(int i=0;i<LevelParam.levels.length;i++)
        {
            this.setLevelNo(this.levelNo+1);
            this.startTime=System.currentTimeMillis();
            setCurrScore(0);
            for(int j=0;j<LevelParam.levels[levelNo-1].getStrTimes();j++)
            {
                String outStr=game.printStr();
                String inStr=input.next();
                game.printResult(outStr,inStr);
            }

        }
    }


    public Player() {
    }

    public Player(int levelNo, int currScore, long startTime, int elapsedTime) {
        setCurrScore(currScore);
        setElapsedTime(elapsedTime);
        setLevelNo(levelNo);
        setStartTime(startTime);
    }

    public int getLevelNo() {
        return levelNo;
    }

    public void setLevelNo(int levelNo) {
        this.levelNo = levelNo;
    }

    public int getCurrScore() {
        return currScore;
    }

    public void setCurrScore(int currScore) {
        this.currScore = currScore;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(int elapsedTime) {
        this.elapsedTime = elapsedTime;
    }
}